package com.goodflower.goodflower.user_register;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.goodflower.goodflower.R;

public class User_register_info extends AppCompatActivity {
    private EditText register_name; //用户名
    private Button register_name_next;//下一步按钮

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_register_info);
        //找到控件
        register_name = (EditText) findViewById(R.id.register_name);
        register_name_next = (Button) findViewById(R.id.register_name_next);
        //下一步按钮
        register_name_next.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //获取name判断是否为空
                String name = register_name.getText().toString();
                if (name == null || name.isEmpty()) {
                    Toast.makeText(User_register_info.this,"您必须取一个名字用来做登录名",Toast.LENGTH_LONG).show();
                }else {
                    Intent refister_name_intent = new Intent(User_register_info.this,User_register_password.class);
                    refister_name_intent.putExtra("name",name);
                    overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
                    startActivity(refister_name_intent);
                }
            }
        });
    }
}
